import { defineStore } from 'pinia';
import { ref } from 'vue';

export const useAiSettingStore = defineStore('aiSetting', () => {
  const selectedAI = ref('DeepSeek R1');
  const model = ref('deepseek r1');  // 添加模型名称字段
  const useDeep = ref(false);

  const setAI = (ai) => {
    selectedAI.value = ai;
  }

  // 添加设置模型的方法
  const setModel = (modelName) => {
    model.value = modelName;
  }

  const toggleDeep = () => {
    useDeep.value = !useDeep.value;
  }

  return {
    selectedAI,
    model,  // 暴露模型名称
    useDeep,
    setAI,
    setModel,  // 暴露设置模型方法
    toggleDeep
  }
},{
  persist: true
});